<template>
	<div class='container'>
	<div class='top-table'>
		<div class='top-title'>
			<p>绑定店铺</p>
			<div v-on:click='addStore' style='cursor:pointer'>
				<img src="@/images/cross.png" alt="">
				<span>增加店铺</span>
			</div>
		</div>
		<div class='bottom-table'>
			<el-table
			:data="getList"
			style="width: 100%">
			<el-table-column
			prop="platform"
			label="平台">
			</el-table-column>
			<el-table-column
			prop="shop_name"
			label="名称">
			</el-table-column>
			<el-table-column
			prop="shop_owner"
			label="旺旺号">
			</el-table-column>
			<el-table-column
			prop="name"
			label="地址">
			</el-table-column>
      <el-table-column
       prop='end_time'
       label='激活时间'
      >
      </el-table-column>
			<el-table-column
			prop="audit"
			label="审核状态">
      <template slot-scope="scope">
        <el-button :type="scope.row.audit == '已激活'?isPrimary:''" size="mini" @click="handleActive(scope.$index, scope.row)">{{scope.row.audit}}</el-button>
      </template>
			</el-table-column>
			<el-table-column
			label="操作">
			  <template slot-scope="scope">
        <el-button
          size="mini"
          @click="handleEdit(scope.row)">编辑</el-button>
        <el-button
          size="mini"
          type="danger"
          @click="handleDelete(scope.row)">删除</el-button>
      </template>
			</el-table-column>
		</el-table>
		</div>
	</div>
	<!-- 添加店铺 -->
	<el-dialog
		:visible.sync="dialogVisible"
		width="30%"
		:before-close="handleClose">
		<div style="margin: 20px;"></div>
		<el-form :rules="rules" ref="formLabelAlign" :label-position="labelPosition" label-width="80px" :model="formLabelAlign">
			 <el-form-item label="选择平台" prop="platform">
					<el-select v-model="formLabelAlign.platform" placeholder="请选择平台" style='width:100%'>
						<el-option
						  v-for='item in options'
							:key='item.value'
						  :label="item.label"
				   		:value="item.value">
						</el-option>
					</el-select>
       </el-form-item>
			<el-form-item label="店铺名称" prop='shopName'>
			<el-input v-model="formLabelAlign.shopName"></el-input>
			</el-form-item>
			<el-form-item label="旺旺号" prop='shopOwner'>
			<el-input type='text' v-model="formLabelAlign.shopOwner"></el-input>
			</el-form-item>
		</el-form>

		<span slot="footer" class="dialog-footer">
		<el-button @click="dialogVisible = false">取 消</el-button>
		<el-button type="primary" @click="confirm('formLabelAlign')">确 定</el-button>
		</span>
	</el-dialog>
	<!-- 分页 -->
	<div class="block">
			<el-pagination
				@size-change="handleSizeChange"
				@current-change="handleCurrentChange"
				:current-page="params.pageIndex"
				layout="total, prev, pager, next, jumper"
				:total="total"
				class='block-page'>
			</el-pagination>
	</div>
	</div>
</template>
<script src='./BindStore.js'>

</script>
<style lang='scss' scoped>
	 @import './BindStore.scss';
</style>
